<template>
	<text>
		{{ strTime }}
	</text>
</template>

<script>
import date from '@/utils/date.js';
export default {
	name: 'comTime',
	data() {
		return {
			timer: null,
			strTime: ''
		};
	},
	mounted() {
		this.timer = setInterval(() => {
			this.strTime = date.formatDate(new Date(), 5);
		}, 1000);
	},
	destroyed() {
		clearInterval(this.timer);
	}
};
</script>

<style></style>
